package com.chinairi.mall;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import com.chinairi.common.utils.ApplicationContextUtil;

/**
 * 工业电商项目启动类
 * @author 李昌赐
 * @since 2020-09-22
 */
@SpringBootApplication
@MapperScan(basePackages = {"com.chinairi.mall.dao", "com.chinairi.common.mapper"})
@ComponentScan(basePackages = {"com.chinairi.common", "com.chinairi.mall"})
@EnableTransactionManagement
@EnableScheduling
@EnableEurekaClient
@EnableFeignClients
public class ScmpIndustrialMallApplication {

    public static void main(String[] args) {
        ApplicationContext app = SpringApplication.run(ScmpIndustrialMallApplication.class, args);
        ApplicationContextUtil.setApplicationContext(app);
        //用该句生成对象。切记：生成完后立马注释掉，否则一旦启动项目，会重新生成覆盖掉原来的代码
        //CodeGenerator.generator("董志涵","mall","Mysql","106.15.181.173,3306,industry,root,Zcc..934947091",false,new String[]{"SYS_USER_LOGIN"});
        //CodeGenerator.generator("Webgasd", "mall", "Mysql", "localhost,3306,industry,root,Whn39258376", false, new String[] {"HOME_PIC"});
//        CodeGenerator.generator("gsl","mall","Mysql","106.15.181.173,3306,industry,root,Zcc..934947091",false,new String[]{"COMP_SHOP"});

    }

}
